<template>
    <div>
        <el-dialog
            title="OCR录入"
            :visible.sync="dialogVisible"
            width="85%"
            :before-close="handleClose"
             :close-on-click-modal="false">
            <div>
                <el-row>
                    <el-col :span="24">
                        选择文件:
                        <input type="file" name="file" @change="getFile">
                        <el-button type="primary" @click="upload">上传</el-button>
                        <el-button type="primary" @click="read">提取</el-button>
                    </el-col>
                </el-row>
                <el-row style="margin-top: 20px" :gutter="20">
                    <el-col :span="8">
                        <div @click="dialogContractVisible = true">
                            pdf预览：
                            <pdf
                                ref="pdf"
                                :src="pdfUrl"
                                :page="1"
                            >
                            </pdf>
                        </div>
                    </el-col>
                    <el-col :span="16">
                        <div>
                            <registration-form ref="registrationForm" v-if="showWin">

                                <el-form ref="ruleForm" :model="formObj" size="small" :rules="rules" label-width="100px">
                                    <el-row>
                                        <el-col :span="12">
                                            <el-form-item label="登记单位" prop="registrationUnit">
                                                <el-input v-model="formObj.registrationUnit" placeholder="请输入" maxlength="30"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="12">
                                            <el-form-item label="填表日期" prop="registerDate">
                                                <el-date-picker
                                                    maxlength="30"
                                                    v-model="formObj.registerDate"
                                                    type="datetime"
                                                    value-format=" yyyy-MM-dd HH:mm:ss"
                                                    format="yyyy-MM-dd HH:mm:ss"
                                                    placeholder="选择日期时间"
                                                ></el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <table class="table table-bordered text-center" cellspacing="0">
                                        <tbody>
                                        <tr>
                                            <td colspan="2">建设单位</td>
                                            <td>
                                                <el-form-item prop="constructionUnit">
                                                    <el-input v-model="formObj.constructionUnit" placeholder="请输入" maxlength="30"></el-input>
                                                </el-form-item>
                                                <!-- <input type="text" class="form-control" placeholder="请输入" /> -->
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">项目建设地址</td>
                                            <td>
                                                <el-form-item label prop="constructionAddress">
                                                    <el-input
                                                        v-model="formObj.constructionAddress"
                                                        placeholder="请输入"
                                                        maxlength="50"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">设计立项文号</td>
                                            <td>
                                                <el-form-item label prop="approvalDocumentNo">
                                                    <el-input v-model="formObj.approvalDocumentNo" placeholder="请输入" maxlength="30"></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">建设开始日期</td>
                                            <td>
                                                <el-form-item label prop="constructionStartTime">
                                                    <el-date-picker
                                                        maxlength="30"
                                                        v-model="formObj.constructionStartTime"
                                                        type="datetime"
                                                        value-format=" yyyy-MM-dd HH:mm:ss"
                                                        format="yyyy-MM-dd HH:mm:ss"
                                                        placeholder="选择日期时间"
                                                    ></el-date-picker>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">竣工日期</td>
                                            <td>
                                                <el-form-item label prop="completedTime">
                                                    <el-date-picker
                                                        maxlength="30"
                                                        v-model="formObj.completedTime"
                                                        type="datetime"
                                                        value-format=" yyyy-MM-dd HH:mm:ss"
                                                        format="yyyy-MM-dd HH:mm:ss"
                                                        placeholder="选择日期时间"
                                                    ></el-date-picker>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">决算批复文号</td>
                                            <td>
                                                <el-form-item label prop="finalAccountsDocumentNo">
                                                    <el-input
                                                        v-model="formObj.finalAccountsDocumentNo"
                                                        placeholder="请输入"
                                                        maxlength="30"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">资产占用单位</td>
                                            <td>
                                                <el-form-item label prop="assetOccupyingUnit">
                                                    <el-input v-model="formObj.assetOccupyingUnit" placeholder="请输入" maxlength="30"></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">上级主管单位</td>
                                            <td>
                                                <el-form-item label prop="superiorCompetentUnit">
                                                    <el-input
                                                        v-model="formObj.superiorCompetentUnit"
                                                        placeholder="请输入"
                                                        maxlength="30"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">资产使用单位</td>
                                            <td>
                                                <el-form-item label prop="assetUseUnit">
                                                    <el-input v-model="formObj.assetUseUnit" placeholder="请输入" maxlength="30"></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="300" rowspan="5">实际形成资产（单位：元）</td>
                                            <td width="200">固定资产</td>
                                            <td>
                                                <el-form-item label prop="fixedAssets">
                                                    <el-input
                                                        v-model="formObj.fixedAssets"
                                                        v-on:blur="calculationTotal"
                                                        placeholder="请输入"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>流动资产</td>
                                            <td>
                                                <el-form-item label prop="currentAssets">
                                                    <el-input
                                                        v-model="formObj.currentAssets"
                                                        v-on:blur="calculationTotal"
                                                        placeholder="请输入"
                                                        maxlength="21"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>无形资产</td>
                                            <td>
                                                <el-form-item label prop="intangibleAssets">
                                                    <el-input
                                                        v-model="formObj.intangibleAssets"
                                                        v-on:blur="calculationTotal"
                                                        placeholder="请输入"
                                                        maxlength="21"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>递延资产</td>
                                            <td>
                                                <el-form-item label prop="deferredAssets">
                                                    <el-input
                                                        v-model="formObj.deferredAssets"
                                                        v-on:blur="calculationTotal"
                                                        placeholder="请输入"
                                                        maxlength="21"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>其他资产</td>
                                            <td>
                                                <el-form-item label prop="otherAssets" class="col-two">
                                                    <el-input
                                                        v-model="formObj.otherAssets"
                                                        v-on:blur="calculationTotal"
                                                        placeholder="请输入"
                                                        maxlength="21"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>不形成资产（单位：元）</td>
                                            <td>待核销基建支出</td>
                                            <td>
                                                <el-form-item label prop="stayWriteOffExpenditure" class="full">
                                                    <el-input
                                                        v-model="formObj.stayWriteOffExpenditure"
                                                        placeholder="请输入"
                                                        maxlength="21"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">合计（单位：元）</td>
                                            <td>
                                                <el-form-item label prop="total">
                                                    <el-input
                                                        v-model="formObj.total"
                                                        v-on:blur="calculationTotal"
                                                        placeholder="请输入"
                                                        maxlength="21"
                                                    ></el-input>
                                                </el-form-item>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">备注</td>
                                            <td>
                                                <el-form-item label prop="remarks" class="full">
                                                    <el-input v-model="formObj.remarks" placeholder="请输入" maxlength="50"></el-input>
                                                </el-form-item>

                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <el-row>
                                        <el-col :span="8">
                                            <el-form-item label="填报人" prop="filledBy">
                                                <el-input v-model="formObj.filledBy" placeholder="请输入" maxlength="30"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="8">
                                            <el-form-item label="复核人" prop="reviewer">
                                                <el-input v-model="formObj.reviewer" placeholder="请输入" maxlength="30"></el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="8">
                                            <el-form-item label="单位负责人" prop="personInCharge">
                                                <el-input v-model="formObj.personInCharge" placeholder="请输入" maxlength="30"></el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>

                                </el-form>


                            </registration-form>
                        </div>
                    </el-col>
                </el-row>
            </div>
            <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">关闭</el-button>
                <el-button type="primary" v-throttle="[ok]">确定</el-button>
            </span>
        </el-dialog>
    </div>
</template>

<script src="./ocr-add.js"></script>
<style scoped lang="scss">

    @include formWrap();
</style>
